{include file="common/head"/}
<div class="admin-main">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>编辑提现</legend>
    </fieldset>
    <blockquote class="layui-elem-quote">
        《管理者》:需要工作人员手动操作向用户支付宝账户进行转账,装张完成勾选"已完成",进行提交<br/>
    </blockquote>
    <form class="layui-form layui-form-pane">
        <input type="hidden" name="id" value="{$withdraw.id}">
        <input type="hidden" name="uid" value="{$withdraw.uid}">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名称</label>
            <div class="layui-input-4">
                <input type="text" name="nickname" value="{$withdraw.nickname}" lay-verify="required" placeholder="{:lang('pleaseEnter')}用户名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付宝账号</label>
            <div class="layui-input-4">
                <input type="text" name="alipay" value="{$withdraw.alipay}" lay-verify="required" placeholder="{:lang('pleaseEnter')}支付宝账号" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">总金额(元)</label>
            <div class="layui-input-4">
                <input type="text" name="total_fee" value="{$withdraw.total_fee}" placeholder="{:lang('pleaseEnter')}提现金额" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">提现状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" {if condition="$withdraw['status'] eq 2"}checked{/if} value="2" title="已完成">
                <input type="radio" name="status" {if condition="$withdraw['status'] eq 1"}checked{/if} value="1" title="未提现">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="withdraw">立即提交</button>
                <a href="{:url('index')}" class="layui-btn layui-btn-primary">返回</a>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$ = layui.jquery;
        form.on('submit(withdraw)', function (data) {
            // console.log(data.field);
            // 提交到方法 默认为本身
            $.post("{:url('edit')}",data.field,function(res){
                if(res.code > 0){
                    layer.msg(res.msg,{time:1800,icon:1},function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.msg,{time:1800,icon:2});
                }
            });
        })
    })
</script>
</body>
</html>